﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace ICalendar.CalendarProperties
{
    /// <summary>
    /// This property specifies the date and time.
    /// </summary>
    /// <value>The date and time is a UTC value.</value>
    [Serializable]
    public abstract class UTCDateTimeBase : CalendarPropertyBase<DateTime>
    {
        protected UTCDateTimeBase()
        {
            this.Value = DateTime.Now;
        }

        protected UTCDateTimeBase(DateTime value)
        {
            this.Value = value;
        }
        #region Overrides of CalendarPropertyBase<DateTime>

        protected override void SetValue(string value)
        {
            this.Value = Convert.ToDateTime(value);
        }

        protected override string GetValue()
        {
            return this.Value.ToICalendarUniversalTimeString();

        }

        protected override void SetParametersFromXParameters(XParameterCollection xparams)
        {

        }

        protected override XParameterCollection GetXParametersFromParameters()
        {
            return null;
        }

        protected override string[] GetXReservedParametersNames()
        {
            return null;
        }

        #endregion
    }
}
